package cn.sdormitory.report.service.impl;

import cn.sdormitory.report.dao.DormitoryStatisticsDao;
import cn.sdormitory.report.service.DormitoryStatisticsService;
import cn.sdormitory.report.vo.DormitoryStatisticsVo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @创建人：zhouyang
 * @创建时间：2021/12/6 22:11
 * @version：V1.0
 */
@Slf4j
@Service("dormitoryStatisticsService")
public class DormitoryStatisticsServiceImpl extends ServiceImpl<DormitoryStatisticsDao, DormitoryStatisticsVo> implements DormitoryStatisticsService {
    @Resource
    DormitoryStatisticsDao dormitoryStatisticsDao;
    @Override
    public List<DormitoryStatisticsVo> getDorStaList(String buildingNo,String storey,String dormitoryNo,int pageNum, int pageSize) {
        int currIndex=(pageNum-1)*pageSize;
        return dormitoryStatisticsDao.getDorStaList(buildingNo,storey,dormitoryNo,currIndex,pageSize);
    }

    @Override
    public Long getDorStaListCount(String buildingNo, String storey, String dormitoryNo) {
        return dormitoryStatisticsDao.getDorStaListCount(buildingNo,storey,dormitoryNo);
    }
}
